import request from '@/utils/request.js';

// 获取组织架构信息的接口
export function getDepartments() {
  return request({
    method: 'GET',
    url: '/company/department',
  });
}

// 删除部门信息的接口
export function delDepartments(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`,
  });
}

// 添加部门信息的接口
export function addDepartments(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data,
  });
}

// 根据id查询部门详细信息的接口
export function getDepartmentsDetails(id) {
  return request({
    method: 'GET',
    url: `/company/department/${id}`,
  });
}

// 根据id修改部门详细信息的接口
export function editDepartmentsDetails(data) {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data,
  });
}
